package com.hou.hpsj_springboot.controller;

import com.hou.hpsj_springboot.entity.R ;

import com.hou.hpsj_springboot.service.FriendListService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("friend")
public class FriendListController {

    @Resource
    private FriendListService friendListService;

    @GetMapping("{email}")
    public R getFriendList(@PathVariable("email")String email){
        return R.ok("查询成功",friendListService.getFriendList(email));
    }
    //根据用户id查找用户主页信息
    @RequestMapping ("/friendPage/{userId}")
    public R getFriendPage(@PathVariable("userId") long userId){
        return R.ok("查询成功",friendListService.selectFriendPageById(userId));
    }
}
